import numpy as np
import matplotlib.pyplot as plt
 
# data to plot
n_groups = 5
#time_10_tasks = (79.7, 65.41, 56.415, 58.76, 59.525)
#time_20_tasks = (153.5, 104.945, 98.27, 109.91, 101.205)
#time_30_tasks = (233.5, 144.715, 122.55, 137.845, 133.285)

# average time
time_10_tasks = (7.97, 6.541, 5.6415, 5.876, 5.9525)
time_20_tasks = (7.675, 5.24725, 4.9135, 5.4955, 5.06025)
time_30_tasks = (7.78333, 4.823833, 4.085, 4.5948333, 4.4428333)

# create plot
fig, ax = plt.subplots()
index = np.arange(n_groups)
bar_width = 0.25
opacity = 0.8
 
rects1 = plt.bar(index, time_10_tasks, bar_width,
                 alpha=opacity,
                 color='r',
                 label='10 orders')
 
rects2 = plt.bar(index + 1.2*bar_width, time_20_tasks, bar_width,
                 alpha=opacity,
                 color='g',
                 label='20 orders')
                 
rects2 = plt.bar(index + 2.4*bar_width, time_30_tasks, bar_width,
                 alpha=opacity,
                 color='b',
                 label='30 orders')
 
plt.xlabel('Num of Robots')
plt.ylabel('Time Per Order (s)')
#plt.title('Scores by person')
plt.xticks(index + bar_width, ('3', '6', '9', '12', '15'))
plt.legend()
 
plt.tight_layout()
plt.show()